 <!-- Example table --> <div class="container_12"> 
      <div class="module">
     <h2><span>Edit Wedding Package</span></h2>
        
     <div class="module-body">
         <div style="margin-top:13px;">
        <?php
        if(isset($errMsg)){?>
        <span class="notification"><?php echo $_MESSESGE[$errMsg];?></span>
        <?php }?></div>
        
        <form action="" name="admin_frm" id="admin_frm" method="post" enctype="multipart/form-data">
            <p>
                <label>
                    Vendor : <?php echo $result['vendor_name']; ?>
                </label>
            </p>
            <p>
                <label>Fixed Cost Items</label>
                <select class="input-short" name="fixed_cost_items[]" id="fixed_cost_items" multiple>
                    <?php echo $fixed_cost_items; ?>
                </select>
            </p>
            <p>
                <label>Variable Cost Items</label>
                <select class="input-short" name="variable_cost_items[]" id="variable_cost_items" multiple>
                    <?php echo $variable_cost_items; ?>
                </select>
            </p>

            <p>
                <label>
                    Venue : <?php echo $result['venue_name']; ?>
                </label>
            </p>
            <p>
                <label>Min Capacity</label>
                <input type="text" class="input-short" name="min_capacity" id="min_capacity" value="<?php echo $result['min_capacity'];?>">
            </p>
            <p>
                <label>Max Capacity</label>
                <input type="text" class="input-short" name="max_capacity" id="max_capacity" value="<?php echo $result['max_capacity'];?>">
            </p>
            <p>
                <label>Title</label>
                <div id="availability_info"></div>
				<input type="text" class="input-short check_availability" name="title" value="<?php echo $result['title'];?>" />
                <!--  <span class="notification-input ni-correct">This is correct, thanks!</span> -->
            </p>  
            
            <p>                                
                <label>Select Theme</label>
                <?php   
                $theme = Wedding::getThemeById();
                if( $theme ){                                      
                    echo '<select class="input-short" name="theme_id">';
                    $selval = $result['theme_id'];
                    foreach( $theme as $row )  {
                        $sel = $selval==$row['id'] ? 'selected' : '';
                        echo '<option value="'.$row['id'].'" '.$sel.'>'.$row['theme'].'</option>';
                    }   
                    echo '</select>';
                }                                                        
                ?>
            </p>
            
            <p>
                <label>Package URL</label>
                <?php echo $result['package_url'];?>
            </p>
                                        
            <p>
                <label>Number Of Days<span class="star">*</span></label>
                <input style="width:50px;" type="text" class="input-short" id="number_of_days" name="number_of_days" value="<?php echo $result['number_of_days'];?>" readonly />
            </p>

            <p>
                <label>Wedding Days Specification</label>
                <table >
                    <?php
                    if(!empty($wedding_schedule)){
                        $i=1;?>
                        <input type="hidden" name="hdnWeddingScheduleIds" value="<?php echo $wedding_schedule_ids; ?>" />
                        <tr>
                            <td>S. No.</td>
                            <td>Specification</td>
                            <td>Venue</td>
                            <td>Image</td>
                            <td></td>
                        </tr>
                        <?php foreach($wedding_schedule as $key => $val){?>
                            <tr>
                                <td><?php echo $i; ?></td>
                                <td><?php echo $val['wedding_specification']; ?></td>
                                <td><?php echo $val['display_name']; ?></td>
                                <td> <img src="../../shaadi-images/wedding-package/days-specification/thumb/<?php   echo $val['image']; ?>"/></td>
                                <td>
                                    Change Image&nbsp;&nbsp;<input type="file" name="wedpg_days_image[]" />
                                </td>
                            </tr>
                        <?php $i++; } 
                    }else{?>
                        <tr><td colspan=4>No Specification Provided</td></tr>
                    <?php } ?>
                </table>
            </p>

            <p>
                <label>From Date</label>
                <input name="from_date" type="text"  class="inputText" value="<?php echo $result['from_date']?>" size="10"/><a href="javascript:showCal('Calendar1')"><img src="<?php echo _SITE_ADMIN_URL_;?>images/calendar.jpg" alt="Click Here to Pick up the date" border="0" /></a>
                <!-- <span class="notification-input ni-error">Sorry, try again.</span> -->
            </p>
            <p>
                <label>To Date</label>
                <input name="to_date" type="text"  class="inputText" value="<?php echo $result['to_date']?>" size="10"/><a href="javascript:showCal('Calendar2')"><img src="<?php echo _SITE_ADMIN_URL_;?>images/calendar.jpg" alt="Click Here to Pick up the date" border="0" /></a>
                <!-- <span class="notification-input ni-error">Sorry, try again.</span> -->
            </p>
            
            <p>
                <label>Maximum Ceromonies</label>
                <input type="text" class="input-short" name="max_ceromonies" value="<?php echo $result['max_ceromonies'];?>" /><!-- <span class="notification-input ni-error">Sorry, try again.</span> -->
            </p>
            <p>
                <label>Priority</label>
                <input type="radio" name="priority" value="1" <?php echo ($result['priority'] == 1)?'checked':''; ?>>True &nbsp;
                <input type="radio" name="priority" value="0" <?php echo ($result['priority'] == 0)?'checked':''; ?>>False
            </p>
            
            <p>
                <label>Tags</label>
                <input type="text" class="input-short" name="tags" value="<?php echo $result['tags'];?>" /><!-- <span class="notification-input ni-error">Sorry, try again.</span> -->
            </p>

            <p>
		        <label>Base Price</label>                                
		        <input type="text" class="input-short" name="price" id="total_cost" value="<?php echo $result['price'];?>">
		    </p>
		    <p>
		        <label>Person Allowed in Base Price</label>                                
		        <input type="text" class="input-short" name="no_of_people" id="no_of_people" value="<?php echo $result['no_of_people'];?>">
		    </p>
		    <p>
		        <label>Per Person Cost (When person exceed the base limit)</label>                                
		        <input type="text" class="input-short" name="per_person_cost" id="per_person_cost" value="<?php echo $result['per_person_cost'];?>">
		    </p>            
            <p>
                <label>Discount</label>
                <input type="text" class="input-short" name="discount" value="<?php echo $result['discount'];?>" />
                <select class="input-short" name="discount_type">                                    
                    <option value="1" <?php if($result['discount_type']=='1'){echo 'selected';}?> >Flat</option>
                    <option value="2" <?php if($result['discount_type']=='2'){echo 'selected';}?> >Percent</option>
                </select>
                <!-- <span class="notification-input ni-error">Sorry, try again.</span> -->
            </p>
            
            
            <p>
                <label>Short Description</label>
                <textarea rows="7" cols="90" class="input-short" name="short_description"><?php echo $result['short_description'];?></textarea>
            </p>
            
            <p>
                <label>Description</label>
                <?php $editor->editor('description', $result['description']) ;?>
            </p>
                                        
            <p>
                <label>Booking Amount</label>
                <input type="text" class="input-short" name="booking_amount" value="<?php echo $result['booking_amount'];?>"  /><!-- <span class="notification-input ni-error">Sorry, try again.</span> -->
            </p>
            
            <p>
                <label>Cancellation Policy</label>
                <textarea rows="7" cols="90" class="input-short" id="cancellation_policy" name="cancellation_policy"><?php echo $result['cancellation_policy']; ?></textarea>
            </p>
            <p>
                <label>Terms & Conditions</label>
                <textarea rows="7" cols="90" class="input-short" id="tc_policy" name="tc_policy"><?php echo $result['tc_policy']; ?></textarea>
            </p>  

            <p>
                <label>Wedding Package Image</label>
                <input type="file" name="package_image" /><br/>
                Thumb Preview : <img src="../../shaadi-images/wedding-package/thumb/<?php echo $result['package_image']; ?>" /><br/>
                <!-- Small Preview : <img src="../../shaadi-images/wedding-package/small/<?php echo $result['package_image']; ?>" /><br/>
                Big Preview : <img src="../../shaadi-images/wedding-package/big/<?php echo $result['package_image']; ?>" /> -->
            </p> 
           
            <p>
                <label>Wedding Images</label>
                <div>
                    <table border="0" cellspacing="0" cellpadding="0" style="border:0px; " >
                        <tr>
                            <?php
                            if(!empty($wedding_package_images)){
                                foreach($wedding_package_images as $key => $val){?>
                                   
                                    <td style="border:0px; ">
                                        <img src="../../shaadi-images/wedding-package/thumb/<?php echo $val['image']; ?>" title="<?php echo $val['image_tooltip']; ?>" />&nbsp;<br/>Title : <?php echo $val['image_title']; ?> &nbsp;<br/>Description : <?php echo $val['image_description']; ?>
                                    </td>
                                    
                                <?php }
                            }else{
                                echo "<td>No wedding image available.</td>";
                            }?>
                        </tr>
                    </table>
                </div>
                <div id="wedding_images"></div>
                <div id="wedding_images_warning"></div>
                <input type="button" name="addImages" value="Add Wedding Images" onclick="addWeddingImages(); ">
            </p>
            
            <fieldset>
                <input class="submit-green" type="submit" name="submit" value="Submit" /> 
               <input class="submit-gray" type="button" value="Cancel" onclick="javascript: window.location='<?php echo _SITE_ADMIN_URL_?>'+'wedding/wedding_mng.php';" />
            </fieldset>
        </form>
     </div> <!-- End .module-body -->

                </div>  <!-- End .module -->
                </div>
                <div style="clear:both;"></div>

<script language="javascript">
addCalendar("Calendar1", "Select Date", "from_date", "admin_frm");
addCalendar("Calendar2", "Select Date", "to_date", "admin_frm");
setFormat("yyyy-mm-dd");
</script>                              
<script type="text/javascript">
	var root_path = '<?php echo _SITE_ADMIN_URL_?>';
	var table = 'wedding_package';
	var field = 'title';

    fields = 0;
    var max_wedding_images = 20;
    function addWeddingImages() {
      if (fields < max_wedding_images) {
        var id = "file" + fields;
        $('#wedding_images').append( "<div style='padding:5px 0px; '><input type='file' name='wedding_images[]' />&nbsp;<input type='text' name='image_title[]' placeholder='Image Title' />&nbsp;<input type='text' name='image_tooltip[]' placeholder='Image Tooltip' />&nbsp;<input type='text' name='image_description[]' placeholder='Image Description' />" +
          " <a href='javascript:void(0); ' onclick='removeWeddingImages(this.parentNode)' >remove</a></div>");

        fields += 1;
      } else {
        document.getElementById('wedding_images_warning').innerHTML =
          "Only "+max_wedding_images+" wedding images allowed.";
        document.form.add.disabled = true;
      }
    }

    function removeWeddingImages( el ) {
      if (fields > 0) {
        document.getElementById('wedding_images_warning').innerHTML = "";
        var parent = document.getElementById('wedding_images');
        parent.removeChild(el);
        fields -= 1;
      }
    }

    $().ready(function() {
		
		$("#admin_frm").validate({
			rules: {
				vendor: "required",
				title: "required",
				theme_id: "required",            
				min_days: {
					required: true,
					digits: true
				},
				max_days: {
					required: true,
					digits: true
				},
				max_ceromonies: {
					required: true,
					digits: true
				},				
				booking_amt: {
                    required: true,
                    number: true
                },
				price: {
                    required: true,
                    number: true
                },
                no_of_people: {
                    required: true,
                    digits: true
                },
                per_person_cost: "number"                
			},
			messages: {
				vendor: "Please select the vendor",
				title: "Please enter title",            
				theme_id: "Please select theme",            
				min_days: "Please enter minimum number of days",
				max_days: "Please enter maximum number of days",
				max_ceromonies: "Enter max ceromonies",				
				booking_amt: "Please enter booking amount",
				price: "Enter base price.",
                no_of_people: "Enter number of people allowed in base price.",
                per_person_cost: "Enter per person cost."             
			}
		});
	});
</script>  
<script type="text/javascript" src="<?php echo _ADMIN_JS_; ?>check_availability.js"></script>